package com.usian.article.controller.v1;

import com.usian.apis.article.ApArticleContentControllerApi;
import com.usian.article.service.ApArticleContentService;
import com.usian.model.article.pojos.ApArticleContent;
import com.usian.model.common.dtos.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * ClassName: ApArticleContentController
 * Author:   WGG
 * Date:    2022-11-2022/11/23-18:26
 * Version: 1.0
 * Description:
 */
@RestController
@RequestMapping("/article/api/v1/articleContent")
public class ApArticleContentController implements ApArticleContentControllerApi {

    @Autowired
    private ApArticleContentService apArticleContentService;

    @Override
    @PostMapping("/saveArticleContent")
    public ResponseResult saveArticleContent(@RequestBody ApArticleContent apArticleContent) {
        return apArticleContentService.saveArticleContent(apArticleContent);
    }

    @GetMapping("/findById/{id}")
    public ApArticleContent findById(@PathVariable("id") Long id){
        return apArticleContentService.findById(id);
    }
}
